using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Controls;

namespace MindFactorial.LaunchPoint.Console.Library
{
    /// <summary>
    /// represents a surface for presenting content in the console
    /// </summary>   
    public class PluginSurface : PluginExtender, ISurfacePresenter, IDeactivateListener
    {
        string _label = null;
        ILabeledPanel _host = null;

        /// <summary>
        /// Gets the label of the surface
        /// </summary>
        public string Label
        {
            get
            {
                return _label;
            }
            protected internal set
            {
                _label = value;
            }
        }

        /// <summary>
        /// gets the host of the current plugin surface
        /// </summary>
        protected ILabeledPanel Host
        {
            get
            {
                return _host;
            }
        }

        /// <summary>
        /// Called when the plugin is being deactivated (replaced by another other 
        /// plugin).  Should be overriden in base classes to provide appropriate 
        /// functionality
        /// </summary>
        public virtual void Deactivate()
        {

        }

        internal void SetHost(ILabeledPanel host)
        {
            this._host = host;
        }

        #region ISurfacePresenter Members
        /// <summary>
        /// gets the surface
        /// </summary>
        public UserControl Surface
        {
            get { return this; }
        }

        #endregion

       
    }


}
